const Router = require('koa-router');
const {db, Op,QueryTypes } = require("../../models/db");
const router = new Router();

// 查询商品库存
router.post('/zd/getGoodCat', async ctx => {
     let usr = ctx.user
    let sql = `select id,name from goods_cat where tenantId=${usr.tenantId} `
    let ret = await db.query(sql, {type: QueryTypes.SELECT})
    let list = [
        {id: 0, name: '全部'},
        {id: -1, name: '最近'},
    ]
    ret.map(row => {
        list.push(row)
    })
    return ctx.suc('', list)
})

module.exports = router;
